import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/home/'
import Layout from '../layout'
import Layoutadmin from '../layout/admin'


Vue.use(VueRouter)
const constantRoutes = [{
        path: '/login',
        name: 'login',
        component: () =>
            import ('../views/login'),
        hidden: true
    }, {
        path: '*',
        name: '404',
        component: () =>
            import ('../views/error/404'),
        hidden: true
    },
    {
        path: '/',
        name: 'Layout',
        component: Layout,
        redirect: '/home',
        children: [{
            path: 'home',
            name: 'Home',
            component: Home,
            meta: { title: 'Dashboard', icon: 'dashboard' }
        },
        {
            path: '/aboutus',
            name: 'aboutus',
            component:() =>
            import ('../views/aboutus'),
            meta: { title: 'Dashboard', icon: 'dashboard' }
        },],
    },
 
]
const createRouter = () => new VueRouter({
    mode: 'history', // require service support
    scrollBehavior: () => ({ y: 0 }),
    routes: constantRoutes
})

const router = createRouter()

// const router = new VueRouter({
//     mode: 'history',
//     base: process.env.BASE_URL,
//     routes,
//     linkActiveClass
// })

export default router